Skip to content

Set session cookie secure flag based on NODE_ENV#3939

Open
Nishthajain7 wants to merge 5 commits into
processing:developfrom
Nishthajain7:secure-cookie
Open

Set session cookie secure flag based on NODE_ENV#3939
Nishthajain7 wants to merge 5 commits into
processing:developfrom
Nishthajain7:secure-cookie

Conversation

@Nishthajain7
Copy link
Copy Markdown
Contributor

Issue:

Fixes #3909

Problem

The session cookie was currently configured with secure: false

Changes:

Update the session configuration to conditionally enable the secure flag when running in production.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

Copy link
Copy Markdown
Contributor

@yugalkaushik yugalkaushik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksen0 the changes look good. This is a great and clean fix that keeps development environments unaffected while properly improving session cookie security. Even though production realistically should never run over plain HTTP, it is still great to enforce secure: true in production as an additional safety measure. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session cookie not enforced secure in production

2 participants